import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/major_hazard/hazard_obligation_mission_entity.dart';

HazardObligationMissionEntity $HazardObligationMissionEntityFromJson(Map<String, dynamic> json) {
  final HazardObligationMissionEntity hazardObligationMissionEntity = HazardObligationMissionEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    hazardObligationMissionEntity.id = id;
  }
  final bool? practicableStatus = jsonConvert.convert<bool>(json['practicableStatus']);
  if (practicableStatus != null) {
    hazardObligationMissionEntity.practicableStatus = practicableStatus;
  }
  final String? riskMeasureDesc = jsonConvert.convert<String>(json['riskMeasureDesc']);
  if (riskMeasureDesc != null) {
    hazardObligationMissionEntity.riskMeasureDesc = riskMeasureDesc;
  }
  return hazardObligationMissionEntity;
}

Map<String, dynamic> $HazardObligationMissionEntityToJson(HazardObligationMissionEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['practicableStatus'] = entity.practicableStatus;
  data['riskMeasureDesc'] = entity.riskMeasureDesc;
  return data;
}

extension HazardObligationMissionEntityExtension on HazardObligationMissionEntity {
  HazardObligationMissionEntity copyWith({
    String? id,
    bool? practicableStatus,
    String? riskMeasureDesc,
  }) {
    return HazardObligationMissionEntity()
      ..id = id ?? this.id
      ..practicableStatus = practicableStatus ?? this.practicableStatus
      ..riskMeasureDesc = riskMeasureDesc ?? this.riskMeasureDesc;
  }
}
